
#SHELL = cmd
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib

#---------------------------------------------------------
C_SOURCE = main

#---------------------------------------------------------
clean: .clean
build: .build
all: .clean .build .run
run: .run
generate: .generate

.build:
	gcc.exe -o3 -w -o bin/${C_SOURCE}.elf src/${C_SOURCE}.c -lm
	objcopy -O binary bin/${C_SOURCE}.elf bin/${C_SOURCE}.gba

.clean:

.generate:
	gfx2gba -t8 -fsrc -oimage-data $(wildcard image/*.bmp)
	
	gfx2gba -pbgPalette -fsrc -oimage-bg-data image-bg/background.bmp
	gfx2gba -pwelcomePalette -fsrc -oimage-bg-data image-bg/welcome.bmp
	gfx2gba -pwinPalette -fsrc -oimage-bg-data image-bg/win.bmp
	gfx2gba -poverPalette -fsrc -oimage-bg-data image-bg/over.bmp
	gfx2gba -pcreditsPalette -fsrc -oimage-bg-data image-bg/credits-bg.bmp

.run:
	VisualBoyAdvance bin/${C_SOURCE}.gba
	


	